(in-package :ws-sql)

; XXX unused since switching to lxml

;;;  XXX we create a new schema everytime through this call	    
(defun create-necessary-types-as-xsd (procedure-descriptions)
  (let ((root (make-xml-element :name "schema"))
	(target-namespace "urn:at.etel.jdbc,.uri")
	(types nil))
    (push (cons "targetNamespace" target-namespace)
	  (xml-element-attributes root))
    (push (cons "xmlns" +xsd-ns-uri+) 
	  (xml-element-attributes root))
    (dolist (procedure procedure-descriptions)
	    (let ((name (first procedure))
		  (type (third procedure)))
	      (let ((type (create-xsd-type name type)))
		(push type (xml-element-children root))
		(push type types))))
    (nreverse (xml-element-children root))
    root))

(defun create-xsd-type (name type)
  (let ((element (new-xml-element :|element|)))
    (setf (xml-element-attributes element)
	  `((:|name| . ,name) (:|type| . "xsd:string")))
    element))


  

       
  

		     
		   
		   
	  
   

	     
	     


	     
	     
	  

